/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1guidemo;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import static javax.swing.JFrame.EXIT_ON_CLOSE;

/**
 *
 * @author apple
 */
public class BorderFrame extends JFrame
{
    private JButton button1;
    private JButton button2;
    private JButton button3;
    private JButton button4;
    private JButton button5;

    public BorderFrame() {
        this.setTitle("这是一个BoderLayout窗体");
        //this.setSize(600, 400);
        //this.setLocation(400, 300);
        this.setBounds(400, 300, 600, 400);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        
        
        button1=new JButton("Button1");
        button2=new JButton("Button2");
        button3=new JButton("Button3");
        button4=new JButton("Button4");
        button5=new JButton("Button5");
        
        this.setLayout(new BorderLayout());
        
        this.add(button1,BorderLayout.NORTH);
        this.add(button2,BorderLayout.SOUTH);
        this.add(button3,BorderLayout.WEST);
        this.add(button4,BorderLayout.EAST);
        this.add(button5,BorderLayout.CENTER);
    }
    
    
}
